package com.wangzhen.jvm;

import java.util.Random;

public class RandomTest {

    public static void main(String[] args) {
        for (int i = 0; i <= 2; i++) {
            Thread thread = new Thread(){
                @Override
                public void run() {
                    Random random = new Random(1024);
                    for (int j = 0; j <= 2; j++) {
                        int r = random.nextInt();
                        System.out.printf("thread : %s, random result: %d \n", Thread.currentThread().getName(), r);

                        try {
                            Thread.sleep(200);
                        } catch (InterruptedException e) {
                            throw new RuntimeException(e);
                        }
                    }

                }
            };
            thread.start();

        }
    }
}
